package ngocthien.game;
import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.FillResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.text.Text;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.opengl.font.Font;
import org.anddev.andengine.opengl.font.FontFactory;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.ui.activity.BaseGameActivity;

import android.graphics.Color;


public class StateOption extends BaseGameActivity{

	private Camera mCamera;
	private BitmapTextureAtlas mBackgroundTexture;
	private Font mFont;
	private Scene mMainScene;
	public static boolean TouchEnabled=true;
	
	public Engine onLoadEngine() {
		// TODO Auto-generated method stub
		this.mCamera=new Camera(0, 0, Global.CAMERA_WIDTH, Global.CAMERA_HEIGHT);
		
		final EngineOptions engineOptions=new EngineOptions(true, ScreenOrientation.LANDSCAPE, new FillResolutionPolicy(), this.mCamera);
		engineOptions.getTouchOptions().setRunOnUpdateThread(true);
		
		return new Engine(engineOptions);
	}

	public void onLoadResources() {
		// TODO Auto-generated method stub
		this.mBackgroundTexture=new BitmapTextureAtlas(256, 256, TextureOptions.DEFAULT);
		FontFactory.setAssetBasePath("font/");
		this.mFont=FontFactory.createFromAsset(this.mBackgroundTexture, this, "Daville Slanted.ttf", 50, true, Color.WHITE);
		this.mEngine.getTextureManager().loadTexture(this.mBackgroundTexture);
		this.mEngine.getFontManager().loadFont(this.mFont);
	}

	public Scene onLoadScene() {
		// TODO Auto-generated method stub

		this.mEngine.registerUpdateHandler(new FPSLogger());
		
		this.mMainScene=new Scene();
		this.mMainScene.setBackground(new ColorBackground(1, 1, 1));
		
		return mMainScene;
	}

	public void onLoadComplete() {
		// TODO Auto-generated method stub
		
	}
	
	private void BackButton(){
		Text text=new Text(Global.CAMERA_WIDTH/16, Global.CAMERA_HEIGHT/4, mFont, "Back"){
			
		};
		
		
	}

}
